package com.wz.jiangsu.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class LoginEvent {
    // 用户id
    public String userId;
    // 用户ip地址
    public String ipAddress;
    // 用户登录成功与否
    public Boolean eventType;
    // 登录时间戳
    public Long timestamp;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof LoginEvent)) return false;
        LoginEvent that = (LoginEvent) o;
        return Objects.equals(getUserId(), that.getUserId()) && Objects.equals(getIpAddress(), that.getIpAddress()) && Objects.equals(getEventType(), that.getEventType()) && Objects.equals(getTimestamp(), that.getTimestamp());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getUserId(), getIpAddress(), getEventType(), getTimestamp());
    }
}
